<?php

Route::group([
    'namespace'  => '\App\Modules\Health\Http\Controllers\Api',
    'middleware' => 'need_vip:health',
    'prefix'     => 'health',
    'as'         => 'health.'
], function () {

    Route::prefix('acu')->name('acu.')->group(function () {
        Route::get('/', 'AcuController@index')->name('index');
        Route::get('item', 'AcuController@item')->name('item');
        Route::get('info/{id}', 'AcuController@info')->name('info')->where(['id' => '\d+']);
        Route::get('search', 'AcuController@search')->name('search');
    });

    Route::prefix('meridian')->name('meridian.')->group(function () {
        Route::get('info/{id}', 'MeridianController@info')->name('info')->where(['id' => '\d+']);

        Route::prefix('note')->name('note.')->group(function () {
            Route::get('info/{id}', 'MeridianController@noteInfo')->name('info')->where(['id' => '\d+']);
            Route::post('fav/{id}', 'MeridianController@favNote')->name('fav')->where(['id' => '\d+']);
            Route::post('rely/{id}', 'MeridianController@noteRely')->name('rely')->where(['id' => '\d+']);
            Route::post('store', 'MeridianController@store')->name('store');
            Route::post('comment', 'MeridianController@comment')->name('comment');
            Route::post('comment/fav/{id}', 'MeridianController@favNoteComment')->name('comment_fav')->where(['id' =>  '\d+']);
        });
    });

    Route::get('breathe', 'BreatheController@index')->name('breathe');

    Route::prefix('disease')->name('disease.')->group(function () {
        Route::get('/', 'DiseaseController@index')->name('index');
        Route::get('item/{id}', 'DiseaseController@item')->name('item')->where(['id' => '\d+']);
        Route::get('info/{id}', 'DiseaseController@info')->name('info')->where(['id' => '\d+']);
        Route::get('search', 'DiseaseController@search')->name('search');

        Route::prefix('plan')->name('plan.')->group(function () {
            Route::get('list', 'PlanController@list')->name('list');
            Route::post('add', 'PlanController@add')->name('add');
            Route::post('delete/{id}', 'PlanController@delete')->name('delete')->where(['id' => '\d+']);
            Route::post('finish', 'PlanController@finish')->name('finish');
        });

        Route::prefix('discern')->name('discern.')->group(function (){
            Route::get('class', 'DiseaseDiscernController@index')->name('class');
            Route::get('list', 'DiseaseDiscernController@list')->name('list');
            Route::get('info/{id}', 'DiseaseDiscernController@info')->name('info');
            Route::post('collect/{id}', 'DiseaseDiscernController@collect')->name('collect');
        });
    });

    Route::get('adv_configs', 'ConfigsController@advConfig')->name('adv_configs');
});
